import {
	defineStore
} from 'pinia'
import {
	port
} from '/service/port';
export const useTitleStore = defineStore('title', {
	state: () => ({
		globalTitle: 'Loading...'
	}),
	actions: {
		async fetchAndSetTitle() {
			const e = await port('getIndexIndex')
			this.globalTitle = e.data.title
			uni.setNavigationBarTitle({
				title: this.globalTitle
			})
		}
	}
})